package com.example.administrator.worldapp;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

public class DetailActivity extends AppCompatActivity {
   TextView mTvId;
   ImageView mIvPic;
   TextView mTvMath;
   TextView mTvGoal;
   TextView mTvScore;
   TextView mTvDetail;
    private Team team;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);

        team = (Team)(getIntent().getSerializableExtra("team"));

        //Toast.makeText(this,team.getName(),Toast.LENGTH_SHORT).show();


        initview();
    }

    private void initview() {
        mTvId=findViewById(R.id.tv_id);
        mIvPic=findViewById(R.id.iv_pic);
        mTvMath=findViewById(R.id.tv_match);
        mTvGoal=findViewById(R.id.tv_score);
        mTvDetail=findViewById(R.id.tv_detail);



        mTvId.setText(team.getId());
        mIvPic.setImageResource(getResources().getIdentifier(team.getPic(),"mipmap",getPackageName()));

        mTvMath.setText("比赛情况："+"胜:"+team.getSheng()+"负："+team.getPing());



    }
}
